import os
from word_tool_suit import *
import random


class Params:
    # output_project_path = (
    #     r"O:\安装介质\notes\dubbo\workspace\credit-card\http24010"  # 输出文件工程
    # )

    # table = "card_litigation_upload_batch"  # 数据库表名称，表名.txt包含列信息，放置当前py路径

    # class_name_basic = uppercase_first_letter(table, "_")

    # package_function = "http.api"

    # package_name_basic = f'package {package_function}.{".".join(table.split("_"))}'

    # output_java_path_basic = (
    #     f"{output_project_path}/src/main/java/http/api/{path_word(table,'_')}"
    # )

    def param(self, name: str):
        return name[0].lower() + name[1::]

    def __init__(self, table) -> None:
        self.table = table
        # self.output_project_path = r"H:\GIT\卡业务系统\credit-card\http24022"
        self.output_project_path = r"E:\xiaodong3"
        self.package_function = "http.api"

        self.class_name_basic = uppercase_first_letter(self.table, "_")  # Entity Name
        self.class_name_basic_param = self.param(
            self.class_name_basic
        )  # Entity Param Name
        self.class_name_controller = self.class_name_basic + "Controller"
        self.class_name_controller_param = self.param(self.class_name_controller)
        self.class_name_mapper = "I" + self.class_name_basic + "Mapper"  # Mapper Name
        self.class_name_service = (
            "I" + self.class_name_basic + "Service"
        )  # Service Name
        self.class_name_service_param = self.param(
            self.class_name_basic + "Service"
        )  # Service Name Param

        self.output_java_path_basic = f"{self.output_project_path}/src/main/java/http/api/" # {path_word(self.table,'_')}

        self.package_name_basic = (
            f'{self.package_function}' # .{".".join(self.table.split("_"))}
        )


def output(path: str):
    _print_output = open(
        path,
        "w",
        encoding="utf-8",
    )
    return _print_output


local_path = __file__  # 当前文件路径

local_dir = os.path.dirname(local_path)+'/数据'  # 当前文件夹

# 生成一个指定范围内的随机整数
serialVersionUID_min_value = 10**18  # 最小值为10的10次方
serialVersionUID_max_value = 9 * 10**18  # 最大值为10的20次方
